package com.project.service.impl;

import com.project.bean.GradeBean;
import com.project.bean.RoleBean;
import com.project.mapper.IGradeMapper;
import com.project.service.IGradeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@Service
@Transactional
public class GradeServiceImpl implements IGradeService {
    @Autowired
    private IGradeMapper gradeMapper;
    @Override
    public List<GradeBean> findByRoleList(Integer[] roleIdArr) {
        if (roleIdArr.length==0){
            return null;
        }
        return gradeMapper.findByRoleList(roleIdArr);
    }

    @Override
    public List<GradeBean> findAll() {
        return gradeMapper.selectList(null);
    }
}
